﻿using DayuCode.Designer.Entity;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DayuCode.Designer.Forms
{
    public partial class FormDataTable : UIForm
    {
        HDataTable m_table;
        public FormDataTable(long tableId, long projectId, long funcId)
        {
            InitializeComponent();
            dataTableControl.SetTable(tableId, projectId, funcId);
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            HDataTable table = dataTableControl.saveData();
            if(table != null)
            {
                m_table = table;
                Close();
                DialogResult = DialogResult.OK;
            }
        }

        public HDataTable Table
        {
            get { return m_table; }
        }
    }
}
